<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='lb' /></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        .feijin-split {
            border-left: 1px dashed #ccc;
        }
    </style>
</head>
<body>

<div class="layui-fluid">


    <div class="layui-card-body">
        <div class="layui-row layui-col-space30">

            <div class="layui-col-xs2 layui-card" style="width:25%;height:120px;">
                <a class="layadmin-backlog-body">
                    <center>
                        <h4><fmt:message key='zsr' /></h4></br>
                        <p><cite style="color:red"><fmt:formatNumber value="${totalAmount}" type="CURRENCY"/></cite></p>
                    </center>
                </a>
            </div>

            <div class="layui-col-xs2 layui-card feijin-split" style="width:25%;height:120px;">
                <a class="layadmin-backlog-body">
                    <center>
                        <h4><fmt:message key='djs' /></h4></br>
                        <p><cite style="color:orange"> <fmt:formatNumber value="${noAmount}" type="CURRENCY"/></cite></p>
                    </center>
                </a>
            </div>
            <div class="layui-col-xs2 layui-card feijin-split" style="width:25%;height:120px;">

                <a class="layadmin-backlog-body">
                    <center>
                        <h4><fmt:message key='jsz' /></h4></br>
                        <p><cite style="color:blue"><fmt:formatNumber value="${applyAmount}" type="CURRENCY"/></cite></p>
                    </center>
                </a>
            </div>
            <div class="layui-col-xs2 layui-card feijin-split" style="width:25%;height:120px;">
                <a class="layadmin-backlog-body">
                    <center>
                        <h4><fmt:message key='yjs' /></h4></br>
                        <p><cite style="color:green"><fmt:formatNumber value="${amount}" type="CURRENCY"/></cite></p>
                    </center>
                </a>
            </div>
        </div>
    </div>


    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">
            <div class="layui-form-item">
                <form name="totalForm" id="totalForm" method="get">

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='ddbh' /></label>
                        <div class="layui-input-inline">
                            <input type="text" name="orderNo" placeholder="<fmt:message key='qsrddmc' />" value="<c:if test='${params.orderNo !=null}'>${params.orderNo}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='shijian' /></label>
                        <div class="layui-input-inline" style="width:250px;">
                            <input type="text" id="feijin-begin-time" style="width:100px;" name="beginTime" placeholder="<fmt:message key='qrskssj' />" value="<c:if test='${params.beginTime !=null}'>${params.beginTime}</c:if>" autocomplete="off" class="layui-input"> -
                            <input type="text" id="feijin-end-time" style="width:100px;" name="endTime" placeholder="<fmt:message key='qsrjssj' />" value="<c:if test='${params.endTime !=null}'>${params.endTime}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-sm layuiadmin-btn-list" id="search"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> <fmt:message key='ss' /></button>
                    </div>

                </form>
            </div>
        </div>
    </div>

    <div class="layui-card">
        <div class="layui-field-box layui-form">

            <a href="javascript:void(0);" class="layui-btn layui-btn-sm layui-btn-warm" id="applyFinal"><i class="layui-icon">&#xe605;</i> <fmt:message key='sqtx' /></a>

            <table class="layui-table" lay-size="sm">
                <thead>
                <%--<th width="5%">--%>
                <%--<input id="checkboxs" type="checkbox" value="${item.id}" lay-ignore lay-skin="primary"/>--%>
                <%--</th>--%>
                <th><fmt:message key='ddbh' /></th>
                <th><fmt:message key='lslx' /></th>
                <th><fmt:message key='lsje' /></th>
                <th><fmt:message key='shijian' /></th>
                </thead>
                <c:forEach items="${page.result}" var="item" varStatus="status">
                    <tr>
                        <td><a href="javascript:void(0);" style="color:blue;" data-id="${item.orderNo}" class="feijin-order-detail">${item.orderNo }</a></td>
                        <td>
                            <c:choose>
                                <c:when test="${item.type eq 1}"><fmt:message key='srxsddsr' /></c:when>
                                <c:when test="${item.type eq 2}"><fmt:message key='zcyezf' /></c:when>
                                <c:when test="${item.type eq 3}"><fmt:message key='zctx' /></c:when>
                                <c:when test="${item.type eq 4}"><fmt:message key='srtxbh' /></c:when>
                                <c:when test="${item.type eq 5}"><fmt:message key='srshtk' /></c:when>
                                <c:when test="${item.type eq 6}"><fmt:message key='srth' /></c:when>
                            </c:choose>
                        </td>
                        <td>
                            <c:choose>
                                <c:when test="${item.type eq 1}"><b style="color:red;">+<fmt:formatNumber value="${item.amount}" type="CURRENCY"/></b></c:when>
                                <c:when test="${item.type eq 2}"><b style="color:green;">-<fmt:formatNumber value="${item.amount}" type="CURRENCY"/></b></c:when>
                                <c:when test="${item.type eq 3}"><b style="color:green;">-<fmt:formatNumber value="${item.amount}" type="CURRENCY"/></b></c:when>
                                <c:when test="${item.type eq 4}"><b style="color:red;">+<fmt:formatNumber value="${item.amount}" type="CURRENCY"/></b></c:when>
                                <c:when test="${item.type eq 5}"><b style="color:red;">+ <fmt:formatNumber value="${item.amount}" type="CURRENCY"/></b></c:when>
                                <c:when test="${item.type eq 6}"><b style="color:red;">+ <fmt:formatNumber value="${item.amount}" type="CURRENCY"/></b></c:when>
                            </c:choose>
                        </td>
                        <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    </tr>
                </c:forEach>
            </table>
            <jsp:include page="/commons/page.jsp" flush="true"/>
        </div>
    </div>

</div>

<script>

    layui.use(['form', 'laydate'], function () {

        var form = layui.form;
        var laydate = layui.laydate;

        laydate.render({
            elem: '#feijin-begin-time'
        });

        laydate.render({
            elem: '#feijin-end-time'
        });

    });


    $(function () {

        //申请提现
        $("#applyFinal").click(function () {

            var id = $(this).attr("data-id");

            layer.open({
                type: 2
                , title: '<fmt:message key='sqtx' />'
                , content: '${web_domain}/supplier/trading/applyWithdraw'
                , maxmin: true
                , area: ['50%', '50%']
                , btn: ['<fmt:message key='tijiao' />', '<fmt:message key='qx' />']
                , yes: function (index, layero) {
                    var submit = layero.find('iframe').contents().find("#submit");
                    submit.click();
                }
            });
        });


        //查看订单详情
        $(".feijin-order-detail").click(function () {

            var id = $(this).attr("data-id");

            layer.open({
                type: 2
                , title: '<fmt:message key='ckxq' />'
                , content: '${web_domain}/supplier/order/' + id + '/orderDetail'
                , maxmin: true
                , area: ['97%', '97%']
                , btn: ['<fmt:message key='fh' />']
            });
        });

    });
</script>
</body>
</fmt:bundle>
</html>
